package com.wyl.mybatis.util;

import org.apache.ibatis.binding.MapperMethod;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author WuYiLong
 * @Date 2024/3/13 14:10
 */
public class SqlParamUtil {

    public static Map<String, Object> filter(Object object) {
        if(object != null) {
            MapperMethod.ParamMap pm = (MapperMethod.ParamMap) object;
            Map<String, Object> paramsMap = new HashMap<>();
            pm.forEach((k,v)->{
                String key = String.valueOf(k);
                if(!key.contains("param")) {
                    paramsMap.put(String.valueOf(k),v);
                }
            });
            return paramsMap;
        }
        return null;

    }
}
